//
//  TopView.m
//  EconomyDemo
//
//  Created by qianfeng01 on 15/7/12.
//  Copyright (c) 2015年 xiangmu. All rights reserved.
//

#import "TopView.h"
#import "UIImageView+WebCache.h"
#import "DetailViewController.h"
#define kScreenSize [UIScreen mainScreen].bounds.size
@implementation TopView
-(void)setImageNames:(NSMutableArray *)imageNames{
    for (int i=0; i<imageNames.count; i++) {
        self.imageView=[[UIImageView alloc] initWithFrame:CGRectMake(i*kScreenSize.width, 0, kScreenSize.width, 170)];
        [self.imageView sd_setImageWithURL:[NSURL URLWithString:imageNames[i]] placeholderImage:[UIImage imageNamed:@"zhanweitu656_382"]];
        
        [self addSubview:self.imageView];
    }
    self.pagingEnabled=YES;
    self.contentSize=CGSizeMake(kScreenSize.width*imageNames.count, 170);
}
-(void)setTitleNames:(NSMutableArray *)titleNames{
    for (int i=0; i<titleNames.count; i++) {
        UILabel *label=[[UILabel alloc] initWithFrame:CGRectMake(i*kScreenSize.width, 140,kScreenSize.width, 30)];
        label.backgroundColor=[UIColor grayColor];
        label.textAlignment=NSTextAlignmentLeft;
        label.font=[UIFont boldSystemFontOfSize:12.0];
        label.textColor=[UIColor whiteColor];
        label.text=titleNames[i];
        label.numberOfLines=0;
        
        [self addSubview:label];
        
    }
}

@end
